<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>选择当前所在位置</title>
		<link rel="stylesheet" type="text/css" href="../../../../static/css/aui.min.css"/>
		<script type="text/javascript" src="../../../../static/js/aui.min.js"></script>
		<script type="text/javascript" src="../../../../static/js/aui.bmap.js"></script>
		<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=Go8TPnKDL44WFZbOATH4AsbA7qTwNosi"></script>
		<style type="text/css">
			.map{width: 100%; height: -webkit-calc(100vh - 100px); height: calc(100vh - 100px);}
			.result-view{width: 100vw; height: 100px; font-size: 0; background: #FFF; position: fixed; bottom: 0; left: 0;}
			.result-view-left{width: -webkit-calc(100vw - 120px); width: calc(100vw - 120px); padding: 0 0 0 15px; box-sizing: border-box; display: inline-block; vertical-align: middle;}
			.result-view-left div{width: 100%; line-height: 25px; font-size: 17px; color: #333; display: inline-block; vertical-align: middle;}
			.result-view-right{width: 120px; height: 100%; padding: 0 15px; box-sizing: border-box; text-align: center; display: inline-block; vertical-align: middle;}
			.result-view-right .aui-btn{width: 100%; height: 40px; line-height: 40px; margin: 30px auto;}
			/*隐藏 百度地图 LOGO*/
			.anchorBL{display:none;} 
		</style>
	</head>
	<body>
		<div class="container">
			<header class="aui-header">
				<a class="aui-header-left" onclick="aui.closeWin()"><i class="iconfont iconreturn"></i></a>
				<div class="aui-header-title">选择当前所在位置</div>
			</header>
			<div class="aui-content">
				<div class="map" id="map"></div>
				<div class="result-view">
					<div class="result-view-left"><div></div></div>
					<div class="result-view-right">
						<button class="aui-btn aui-btn-blue confirm">确定</button>
					</div>
				</div>
			</div>
		<div>
	</body>
	<script type="text/javascript">
		window.addEventListener("load", function(){
			//打开地图
			aui.openMap("map", function(ret){ //第一个参数必须是显示地图的dom元素ID
				console.log(JSON.stringify(ret));
				document.querySelector(".result-view-left div").innerText = ret.address;
			});			
			//确定选择
			document.querySelector(".confirm").addEventListener("click", function(){
				aui.alert({
					title: '地址选择',
					msg: "您选择的地址是：" + document.querySelector(".result-view-left div").innerText,
					mask: true,
					touchClose: true
				}, function(ret){
					aui.closeWin();
				});
			});
		});
	</script>
</html>
